package com.easthome.util;

import java.io.FileWriter;
import java.io.IOException;
/*
这个文档会有特殊字符，需要处理一下
 */

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016102600764235";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCI86HnJBmSRFo1hCUPnBgp1si1+pFDcCuyF3Gwflkrw8yGCy6Os1Y/O/z3GMdRH91XNgF9vVlplsqoxuJ2k9oIxB9E7K0XpHpzxmGjN6BGKtxwlXxhsB8pTA0u+NbV5F0Iuspd9rlsICh85JulrwO2GfqLyqek1JWSRO45uj5BLJ84Hs2edNVYceS3zTPuG8meLbD6jI0n/I1ULsZyM5OK0bhCos1SyMFdokj96pvR9wuUh0gpemF1zpLD6rrTSSbkgQ80s2AQsnHiY5BI7scXynh0J1uiopOc+qhITKYakcaLJjxgTtDkNCpIzX8TLaPOF6mbuuCoJo6SqBHMxnJ7AgMBAAECggEAEL2PPdzYz1tRl5cWnKjc/0hE8pG1bgPpI3TgLc3UApiFiKEXSNQ9J6+ihWXe/1igysdMOV2K73BCR41AI3SBQ28Nz3QK2If/e+V1C+mByvH0TkLHmH1Z4cdtGR/LywuGH8oNcJz3H3Ny34lmSUNydbEJQks8YNanjeClKiNM9tRaSk8POf4x1p2gnVRdoyzhMaVaF5HxQgiFM98n37Yt2t02gQMctDigSr9nNBX2zqvVpNGk8SEVSaUkmj3EV7ySYrxanQA5TnDVGTM89XrAXtEoDZLCJcrJWpe+myPpNAj8aqoKjSwpavs+CHy09K/bY1/dgkJ6lwYtyNth5CKHAQKBgQDXpLScJJA+rPoev5FGWI9JhMQ0Qu2+rYZ/dQNr6AoyFduPcUwojimswjh5tn4OUciRbEYdOL7jxNefv5af4WtkCG/V0gzR1Oh8ESUB5xfPkqR/InUFBJBdY+07Vp8D69LIRL8ZNhUUXzHujJvqcyNiE3GbPbBjuZ7dsrRMn4mw+wKBgQCilN+lifQPiJ7xr9qv0+kY5XdM8gjwKSwJUkurXF3uKHTiqr9vxjVq2DQX1eknIAmGoZUfuyQqbCZEry+PkX1QWesnQUMArc2+6nJqcM3tmHcExJ3dCf0l6cQtCR4Tb8VGL/SBC4ZhT/j3MrHvFIagmWgATXz1nR0HF1OlfeGMgQKBgANhFl94BzakOUswD1O94YjyZqy2+8jIKVpn+ATB3x8HzqgBy4K7L5YAeSgXHwSUbYMx4itlD0C8ffCH7RFWU/t+UlpUb1T+dCI1lpHgEDR1hNRlMtZASw7bmQUcB2PlVylCQohfm5b1IvAtDehvo3dO/LHFFrWJXB73RPIKcfrvAoGATMJ5LREK9+KLGJTsbSNh5G1CfEOx0KG/ts7yBv/fIThcpz/yjnVIdx+IyNAn+l734Gadn5OdqaHSF4+WpvQL9Enf6nK3jbSBdWf/iR2lPE5FsyyZU+kJakMKajDp0EdvHoo5qEumsH8vjpaSx8wrG9wR7EKpgtUhBV4QEgxy1wECgYEAjzofwnKSH/19KpbDrhuM/nmXAwsE9nEqj8grw3goILWoCwKVq4zcvSj+3RdXVJCj64gU9N05ClXAsLLNntHVxLjEYz+8fiIwtz9Z47izfYZZ4c+lhQYIh85vJ0kaWDJXcjKSCmdRs4ME6amDFWg2KSDmMejIcE7+6rA7zE2rLRA=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgT+E8MR9Qi5yeMrfAXQSu9hZd1B3pPiHGAyhy2e9pSkKoIgF7++mmbU88Kh+0qmhP+0Al7swxYi/BESP4B72eWKp8Q9SY+2Rb1MVmpYgoDZl2HyPUS1tTFgnzgr06ROzs6VHZyMbcfLM/XqLHnlgo0DYBHaNXMiDOawHBQEyuGM9pMsAjRHWj+e4DXtDckrRZO+77lvH4xtedzwjKFQss+AG+ZP6RbhZ9/TMuMGFwaKw7JUx5RnJFDEq6xmfq4yvu+v2hSzuJe9o/XSxMLUDOsRcd5lx7u/eZulqzWHoEVNK+iCS04AsBepUX2eKMsZ/R88ylwVnLDZxFa39EOJaYwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://xiaoniancy.eicp.net/mall_ssm01/alipay/payNotify";
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/mall/alipay/paySuccess";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关(注意这里的路径，这里缺少dev)
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

